A time series chart, also called a times series graph or time series plot, is a data visualization tool that illustrates data points at successive intervals of time. Each point on the chart corresponds to both a time and a quantity that is being measured.
# Change dataset to Time Series format
Turtle.ts.eggs <- xts(Turtle$egglaying, Turtle$Date)
Turtle.ts.nest <- xts(Turtle$nharv, Turtle$Date)
#Create the Time Series Chart
Chart <- highchart(type = "stock") %>%
hc_title(text = "Total number of Egg Laying Females and Percent of Nests Harvested
<br>Ostional - Costa Rica, Period 2006-2010</br>") %>%
hc_subtitle(text = "Figure Adapted from: Valverde et al. 2012") %>%
hc_yAxis_multiples(list(title = list(text = "Egg Laying Females (total number)"), opposite = FALSE),
list(showLastLabel = FALSE, opposite = TRUE, title = list(text = "Nests Harvested (percent)"))) %>%
hc_add_series(Turtle.ts.eggs, yAxis = 0, type = "column",
pointInterval= 30*24*3600*1000, name="Egg Laying Females", color = "#2F528F")%>%
hc_add_series(Turtle.ts.nest, yAxis = 1, type = "spline",
pointInterval= 30*24*3600*1000, name="Percentage of Nests Harvested", color = "#ED7D31")%>%
hc_plotOptions(spline = list(marker = list(enabled = TRUE, radius = 4))) %>%
hc_xAxis(title= list(text='Date'), type='datetime')